import http from '@/utils/http'
import type * as System from './type'

/** @desc 获取用户数据 */
export function getSystemUserList(params: { pageNo: number; pageSize: number; status: number; realName: string }) {
  return http.post<PageRes<System.UserItem[]>>('/system/admin/user/page', params)
}

/** @desc 获取用户详情 */
export function getSystemUserDetail(id: string) {
  return http.get<System.UserDetailResult>(`/system/admin/user/detail/${id}`)
}

/** @desc 保存用户 */
export function createSystemUser(data: any) {
  return http.post<boolean>('/system/admin/user/create', data)
}

export function modifySystemUser(data: any) {
  return http.post<boolean>('/system/admin/user/modify', data)
}

/** @desc 删除用户 */
export function deleteSystemUser(id: string) {
  return http.deleted<string[]>(`/system/admin/user/remove/${id}`)
}
